<template>
  <div class="Dialog">
    <el-dialog v-model="centerDialogVisible" title="删除提示" width="30%">
      <span>确认删除所选内容吗？</span>
      <template #footer>
        <span class="dialog-footer">
          <el-button @click="clone(false)">取消</el-button>
          <el-button type="primary" @click="sureDel(false)">确认删除</el-button>
        </span>
      </template>
    </el-dialog>
  </div>
</template>
<script setup lang="ts">
import { ref, computed } from 'vue'
import { useStore } from '@/store'
import bus from '@/utils/bus'
import { batchContentDel } from '@/api/concreation.ts'
const store = useStore()

const centerDialogVisible = ref(true)
let props = defineProps<{
  Dialog: { type: any }
}>()

const clone = (judge: boolean) => {
  bus.emit('Dialog', judge)
}
const selection = computed(() => {
  return store.getters['table'].tableData
})
const sureDel = (judge: boolean) => {
  let videoId = selection.value
  // console.log(DataVideo)
  let params = {
    type: 4,
    content_ids: videoId
  }

  batchContentDel(params).then((res) => {
    console.log(res)
    localStorage.removeItem('videoId')
    bus.emit('Dialog', judge)
    bus.emit('removeCheckId')
  })
}
</script>

<style lang="scss" scoped>
.Dialog {
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;
  background: rgba($color: #000, $alpha: 0.5);
  z-index: 999999;
}
.dialog-footer button:first-child {
  margin-right: 10px;
}
</style>